package com.tqjc.system.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 86195
 * @version 1.0
 * @description 任务状态枚举
 * @date 2023/10/19 10:50
 */
@Getter
@AllArgsConstructor
public enum TaskStatusEnum {

    STATUS_DOING("99","执行中","任务执行中"),
    STATUS_UNDOING("1","未执行","任务未执行"),
    STATUS_LOAD("2","待上报","任务待上报"),
    STATUS_COMPLETE("3","已完成","任务已完成"),
    STATUS_ERROR("10","失败","任务失败");

    /**
     * 状态码值
     */
    private String status;

    /**
     * 中文释义
     */
    private String chineseDesc;

    /**
     * 描述
     */
    private String desc;


    public static String getDescByStatus(String status){
        for (TaskStatusEnum value : TaskStatusEnum.values()) {
            if(value.status.equals(status)){
                return value.chineseDesc;
            }


        }
        return "未知状态";
    }
}
